package com.blog.cloud.api.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.blog.cloud.api.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

/**
 * 用户表(User)表实体类
 *
 * @author 龙茶清欢
 * @since 2023-02-26 18:38:36
 */
@Getter
@Setter
@TableName("t_user")
@Schema(name = "用户表实体", description = "用户表映射")
public class User extends BaseEntity implements Serializable {
    @Serial
    private static final long serialVersionUID = 395253732165783741L;

    @TableId(value = "user_id" , type = IdType.AUTO)
    @Schema(description = "用户ID")
    private Long userId;

    @TableField(value = "username")
    @Schema(description = "用户名")
    private String username;

    @TableField(value = "password")
    @Schema(description = "密码")
    private String password;
    
    @TableField(value = "gender")
    @Schema(description = "性别(1-男 2-女)")
    private Boolean gender;
    
    @TableField(value = "nick_name")
    @Schema(description = "昵称")
    private String nickName;
    
    @TableField(value = "avatar")
    @Schema(description = "个人头像")
    private String avatar;
    
    @TableField(value = "email")
    @Schema(description = "邮箱")
    private String email;
    
    @TableField(value = "birthday")
    @Schema(description = "出生年月日")
    private Date birthday;
    
    @TableField(value = "mobile")
    @Schema(description = "手机")
    private String mobile;
    
    @TableField(value = "description")
    @Schema(description = "自我简介")
    private String description;
    
    @TableField(value = "login_count")
    @Schema(description = "登录次数")
    private Integer loginCount;
    
    @TableField(value = "last_login_time")
    @Schema(description = "最后登录时间")
    private Date lastLoginTime;
    
    @TableField(value = "last_login_ip")
    @Schema(description = "最后登录IP")
    private String lastLoginIp;
    
    @TableField(value = "ip_source")
    @Schema(description = "ip来源")
    private String ipSource;
    
    @TableField(value = "browser")
    @Schema(description = "浏览器")
    private String browser;
    
    @TableField(value = "os")
    @Schema(description = "操作系统")
    private String os;
    
    @TableField(value = "salt")
    @Schema(description = "随机盐")
    private String salt;
    
    @TableField(value = "status")
    @Schema(description = "状态(0-开启 1-关闭)")
    private Boolean status;
}

